var nav = document.querySelectorAll(".box ul li");
var dis = document.querySelectorAll(".main .cont");

for(var i = 0; i < nav.length; i++){
    nav[i].index = i;
    nav[i].addEventListener("mouseover",function(){
        for(var j = 0; j<dis.length; j++){
            nav[j].classList.remove('active');
            dis[j].classList.remove('active');
        }
        this.classList.add('active');
        dis[this.index].classList.add('active');
    });


}